package lanqiao;

import java.util.Scanner;

public class LongestSubsequence {
    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
//       int n  =sc.nextInt();
//       int[] arr = new int[n];
//        for (int i = 0; i < n; i++) {
//            arr[i] = sc.nextInt();
//        }
        int[] arr = {2 ,1 ,4 ,7, 4 ,8 ,3, 6, 4 ,7};
        int left = 0, index = 1;
        int right = 0;
        while(left < arr.length) {
            while(arr[left] < arr[right]) {
                right++;
            }
            index = right;
            right = left + 1;
            while(arr[left] > arr[right]) {
                left++;
            }
            left++;
        }
    }
}
